<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition>

            <div id="post">


                <h3>Lista de Conteúdos</h3>

                <div id="stylized" class="myform">

                    <h:outputLabel>Disciplina<span class="small">Selecione uma Disciplina</span></h:outputLabel>
                    <h:selectOneMenu id="disciplina" value="#{QuestaoProfessorController.disciplinaProfessor}">
                        <f:ajax event="change" render="ementa" />
                        <f:ajax event="change" render="tableConteudo" />
                        <f:selectItems value="#{DisciplinaProfessorController.disciplinaProfessorLogado}" var="disciplinaProfessorTemp" itemLabel="#{disciplinaProfessorTemp.disciplina.nome}" />
                    </h:selectOneMenu>


                    <h:outputLabel>Ementa<span class="small">Selecione uma Ementa</span></h:outputLabel>
                    <h:selectOneMenu id="ementa" value="#{QuestaoProfessorController.ementa}">
                        <f:ajax event="change" render="tableConteudo" />
                        <f:selectItems value="#{QuestaoProfessorController.ementas}" var="ementaTemp" itemLabel="#{ementaTemp.ementa}" />
                    </h:selectOneMenu>

                    <h:outputLabel>Nome do Conteudo: <span class="small">nome para busca</span></h:outputLabel>
                    <h:inputText id="seachConteudo" value="#{QuestaoProfessorController.searchConteudo}">
                    </h:inputText>



                    <h:commandButton styleClass="button" id="pesquisar" action="#{QuestaoProfessorController.pesquisarConteudo}" value="Pesquisar" />


                </div>


                <p:dataTable id="tableConteudo" var="conteudoTemp" value="#{QuestaoProfessorController.conteudos}" emptyMessage="Nenhum Arquivo Encontrado" paginator="false">

                    <p:column sortBy="#{conteudoTemp.conteudo}">
                        <f:facet name="header">
                            <h:outputText value="Conteudo" />
                        </f:facet>
                        <h:outputText value="#{conteudoTemp.conteudo}" />
                    </p:column>


                    <p:column style="text-align: center;" >
                        <f:facet name="header">
                            <h:outputText value="Painel" />
                        </f:facet>
                        <p:commandButton image="ui-icon-pencil" title="incluir" actionListener="#{QuestaoProfessorController.incluir}" value="Incluir" ajax="false" />
                    </p:column>
                </p:dataTable>
            </div>
        </ui:composition>

    </body>
</html>
